package com.asset.crm.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@SuppressWarnings("serial")
@Entity
@Table(name="follow")
public class Follow implements Serializable{

	private Integer id;
	private Employee follower;
	private Employee followed;
	private Date date;
	
	
 	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="follow_id_seq")
	@SequenceGenerator(name="follow_id_seq",sequenceName="follow_id_seq",allocationSize=1)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name="follower_id")
	public Employee getFollower() {
		return follower;
	}
	public void setFollower(Employee follower) {
		this.follower = follower;
	}
	
	@ManyToOne
	@JoinColumn(name="followed_id")
	public Employee getFollowed() {
		return followed;
	}
	public void setFollowed(Employee followed) {
		this.followed = followed;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="date")
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	
}
